package com.itheima.a03threadcase3;

import java.util.concurrent.Callable;

// 也可以写成public class MyCallable implements Callable<Integer>
//那么call方法会变成public Integer call() throws Exception {
public class MyCallable implements Callable {
    @Override
    public Object call() throws Exception {
        int sum = 0;
        for (int i = 1; i <= 100; i++){
            sum = sum +i ;
        }
        return sum;
    }
}
